<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>nexus3搭建私有源 | 小朱的网站</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/fav.ico">
    <link rel="stylesheet" href="/css/katex.min.css">
    <link rel="stylesheet" href="/css/github-markdown.min.css">
    <meta name="description" content="网页测试">
    
    <link rel="preload" href="/assets/css/0.styles.7f64417e.css" as="style"><link rel="preload" href="/assets/js/app.adf242e6.js" as="script"><link rel="preload" href="/assets/js/2.8cf67c90.js" as="script"><link rel="preload" href="/assets/js/30.e219df5c.js" as="script"><link rel="prefetch" href="/assets/js/10.15f163a4.js"><link rel="prefetch" href="/assets/js/11.a27afcec.js"><link rel="prefetch" href="/assets/js/12.27eb6ae9.js"><link rel="prefetch" href="/assets/js/13.0264e853.js"><link rel="prefetch" href="/assets/js/14.0e338da5.js"><link rel="prefetch" href="/assets/js/15.18feaada.js"><link rel="prefetch" href="/assets/js/16.131aa977.js"><link rel="prefetch" href="/assets/js/17.bc458c69.js"><link rel="prefetch" href="/assets/js/18.a943de2b.js"><link rel="prefetch" href="/assets/js/19.28b106c6.js"><link rel="prefetch" href="/assets/js/20.3b5e14bb.js"><link rel="prefetch" href="/assets/js/21.76010c7a.js"><link rel="prefetch" href="/assets/js/22.a1f4c10c.js"><link rel="prefetch" href="/assets/js/23.c62fd73c.js"><link rel="prefetch" href="/assets/js/24.29fa4cff.js"><link rel="prefetch" href="/assets/js/25.d0caf08f.js"><link rel="prefetch" href="/assets/js/26.fcbe8a2e.js"><link rel="prefetch" href="/assets/js/27.028c550c.js"><link rel="prefetch" href="/assets/js/28.94fcec24.js"><link rel="prefetch" href="/assets/js/29.d2fd21a3.js"><link rel="prefetch" href="/assets/js/3.7b0f057b.js"><link rel="prefetch" href="/assets/js/31.26e4967d.js"><link rel="prefetch" href="/assets/js/32.dd5db7fd.js"><link rel="prefetch" href="/assets/js/33.541725d2.js"><link rel="prefetch" href="/assets/js/34.7269715f.js"><link rel="prefetch" href="/assets/js/35.19b86b0e.js"><link rel="prefetch" href="/assets/js/36.240ce0fb.js"><link rel="prefetch" href="/assets/js/37.3b5e2f37.js"><link rel="prefetch" href="/assets/js/4.60158cd1.js"><link rel="prefetch" href="/assets/js/5.6154fd2f.js"><link rel="prefetch" href="/assets/js/6.d914717c.js"><link rel="prefetch" href="/assets/js/7.e50321c3.js"><link rel="prefetch" href="/assets/js/8.50a0932a.js"><link rel="prefetch" href="/assets/js/9.5e7ea4bd.js">
    <link rel="stylesheet" href="/assets/css/0.styles.7f64417e.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">小朱的网站</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://datav.aliyuncs.com/share/c5fe85f805b0425186d01be47dc34322" target="_blank" rel="noopener noreferrer" class="nav-link external">
  数据可视化实践
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/front-end/" class="nav-link">
  前端技术小结
</a></div><div class="nav-item"><a href="/office/" class="nav-link">
  高效办公方法
</a></div><div class="nav-item"><a href="/general/" class="nav-link router-link-active">
  通用知识速查
</a></div><div class="nav-item"><a href="/CPC/" class="nav-link">
  政治教育学习
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="⭐️资源" class="dropdown-title"><span class="title">⭐️资源</span> <span class="arrow down"></span></button> <button type="button" aria-label="⭐️资源" class="mobile-dropdown-title"><span class="title">⭐️资源</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://echarts.apache.org/examples/zh/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  echarts示例
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://report.anji-plus.com/report-doc/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  AJ-Report
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://help.aliyun.com/document_detail/86874.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  阿里云DataV
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://gitee.com/all-about-git" target="_blank" rel="noopener noreferrer" class="nav-link external">
  码云Git大全
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://www.dedao.cn/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  得到APP网页版
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://edu.dji.com/hub/docs" target="_blank" rel="noopener noreferrer" class="nav-link external">
  大疆教育平台
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://datav.aliyuncs.com/share/c5fe85f805b0425186d01be47dc34322" target="_blank" rel="noopener noreferrer" class="nav-link external">
  数据可视化实践
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/front-end/" class="nav-link">
  前端技术小结
</a></div><div class="nav-item"><a href="/office/" class="nav-link">
  高效办公方法
</a></div><div class="nav-item"><a href="/general/" class="nav-link router-link-active">
  通用知识速查
</a></div><div class="nav-item"><a href="/CPC/" class="nav-link">
  政治教育学习
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="⭐️资源" class="dropdown-title"><span class="title">⭐️资源</span> <span class="arrow down"></span></button> <button type="button" aria-label="⭐️资源" class="mobile-dropdown-title"><span class="title">⭐️资源</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://echarts.apache.org/examples/zh/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  echarts示例
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://report.anji-plus.com/report-doc/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  AJ-Report
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://help.aliyun.com/document_detail/86874.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  阿里云DataV
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://gitee.com/all-about-git" target="_blank" rel="noopener noreferrer" class="nav-link external">
  码云Git大全
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://www.dedao.cn/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  得到APP网页版
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-item"><!----> <a href="https://edu.dji.com/hub/docs" target="_blank" rel="noopener noreferrer" class="nav-link external">
  大疆教育平台
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><a href="/general/git.html" class="sidebar-link">git 使用攻略</a></li><li><a href="/general/markdown.html" class="sidebar-link">Markdown基本语法</a></li><li><a href="/general/nexus.html" aria-current="page" class="active sidebar-link">nexus3搭建私有源</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/general/nexus.html#nexus初始化" class="sidebar-link">Nexus初始化</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/general/nexus.html#下载nexus3软件" class="sidebar-link">下载Nexus3软件</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#运行nexus" class="sidebar-link">运行nexus</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#进入nexus" class="sidebar-link">进入Nexus</a></li></ul></li><li class="sidebar-sub-header"><a href="/general/nexus.html#pypi代理服务器搭建" class="sidebar-link">Pypi代理服务器搭建</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/general/nexus.html#创建pypi仓库" class="sidebar-link">创建Pypi仓库</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#设置仓库类型" class="sidebar-link">设置仓库类型</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#配置pypi仓库" class="sidebar-link">配置Pypi仓库</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#典型仓库示例" class="sidebar-link">典型仓库示例</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#仓库使用" class="sidebar-link">仓库使用</a></li></ul></li><li class="sidebar-sub-header"><a href="/general/nexus.html#npm代理服务器搭建" class="sidebar-link">NPM代理服务器搭建</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/general/nexus.html#增加npm源" class="sidebar-link">增加NPM源</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#设置与使用" class="sidebar-link">设置与使用</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#maven代理服务器搭建" class="sidebar-link">Maven代理服务器搭建</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#增加maven代理" class="sidebar-link">增加Maven代理</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#修改maven使用配置" class="sidebar-link">修改Maven使用配置</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#利用命令行下载包" class="sidebar-link">利用命令行下载包</a></li><li class="sidebar-sub-header"><a href="/general/nexus.html#gradle中配置使用" class="sidebar-link">Gradle中配置使用</a></li></ul></li></ul></li><li><a href="/general/latex.html" class="sidebar-link">Katex 公式格式速查</a></li><li><a href="/general/vscode.html" class="sidebar-link">VS Code 常用操作</a></li><li><a href="/general/guide.html" class="sidebar-link">搭建指南</a></li><li><a href="/general/reg.html" class="sidebar-link">正则表达式</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="nexus3搭建私有源"><a href="#nexus3搭建私有源" class="header-anchor">#</a> nexus3搭建私有源</h1> <h2 id="nexus初始化"><a href="#nexus初始化" class="header-anchor">#</a> Nexus初始化</h2> <h3 id="下载nexus3软件"><a href="#下载nexus3软件" class="header-anchor">#</a> 下载Nexus3软件</h3> <p>首先去官方下载<a href="https://sonatype-download.global.ssl.fastly.net/nexus/3/latest-win64.zip" target="_blank" rel="noopener noreferrer">windows x64软件包<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>, 直接下载可能会被墙，建议使用迅雷下载.</p> <h3 id="运行nexus"><a href="#运行nexus" class="header-anchor">#</a> 运行nexus</h3> <ol><li>nexus需要java1.8以上运行环境，首先确保电脑上有安装。</li> <li>下载软件包，解压，进入“\nexus-3.17.0-01\bin&quot;目录，可以看到该目录有&quot;nexus.exe&quot;文件, 在该目录打开命令行，运行&quot;nexus.exe /run&quot;命令, 就可以启动nexus服务了.</li></ol> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>更方便的做法是将nexus.exe文件发送到桌面快捷方式, 修改快捷方式命令, 加入&quot;/run&quot;指令即可.</p></div> <h3 id="进入nexus"><a href="#进入nexus" class="header-anchor">#</a> 进入Nexus</h3> <ol><li>服务启动完毕后, 在浏览器中输入<code>http://localhost:8081/</code>进入nexus主页. 第一次进入需要点击右上角的登录, 用户名为<code>admin</code>, 对于老版本的Nexus, 默认密码为<code>admin123</code>, 新版本则放在了<code>admin.password</code>文件中. 登陆后必须要修改管理员密码.</li></ol> <h2 id="pypi代理服务器搭建"><a href="#pypi代理服务器搭建" class="header-anchor">#</a> Pypi代理服务器搭建</h2> <h3 id="创建pypi仓库"><a href="#创建pypi仓库" class="header-anchor">#</a> 创建Pypi仓库</h3> <p>登录服务器之后, 按照下图创建仓库:<br> <img src="https://s1.ax1x.com/2020/03/28/Gk9YfU.png" alt="创建pypi仓库"></p> <h3 id="设置仓库类型"><a href="#设置仓库类型" class="header-anchor">#</a> 设置仓库类型</h3> <p>在仓库选择地方, 有不同类型的仓库, 选择<code>pypi(proxy)</code>, 即pypi的代理仓库(代理仓库就是找不到软件包时会去指定源下载, 下载之后就保存在nexus上)</p> <h3 id="配置pypi仓库"><a href="#配置pypi仓库" class="header-anchor">#</a> 配置Pypi仓库</h3> <p>创建代理服务器的设置, 最重要的是名字和远程源地址(注意: 远程源地址不需要加simple), 常用的豆瓣源为: <code>https://pypi.doubanio.com</code><br> <img src="https://s1.ax1x.com/2020/03/28/GkPwIx.png" alt="pypi仓库设置"></p> <h3 id="典型仓库示例"><a href="#典型仓库示例" class="header-anchor">#</a> 典型仓库示例</h3> <p>一个典型的设置如下图所示, 使用时的源地址为:<code>http://localhost:8081/repository/pypi-proxy/simple/</code>, 这时候需要加上simple.<br> <img src="https://s1.ax1x.com/2020/03/28/GkPLes.png" alt="pypi仓库示例"></p> <h3 id="仓库使用"><a href="#仓库使用" class="header-anchor">#</a> 仓库使用</h3> <p>使用时, 临时指定源的命令为: <code>pip install itchat -i http://localhost:8081/repository/pypi-proxy/simple</code>, 全局设置在文件<code>%APPDATA%\pip\pip.ini</code>中, 例如<code>C:\Users\weiwe\AppData\Roaming\pip\pip.ini</code>设置如下:</p> <div class="language-ini extra-class"><pre class="language-ini"><code><span class="token header"><span class="token punctuation">[</span><span class="token section-name selector">global</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">timeout</span> <span class="token punctuation">=</span> <span class="token value attr-value">600</span>
<span class="token key attr-name">index-url</span> <span class="token punctuation">=</span> <span class="token value attr-value">https://pypi.doubanio.com/simple</span>
<span class="token key attr-name">trusted-host</span> <span class="token punctuation">=</span> <span class="token value attr-value">pypi.doubanio.com</span>
<span class="token header"><span class="token punctuation">[</span><span class="token section-name selector">list</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">format</span> <span class="token punctuation">=</span> <span class="token value attr-value">columns</span>
</code></pre></div><p>其中，timeout：设置超时时间，index-url：指定下载源，trusted-host：指定域名。</p> <p>国内常用的镜像源有：</p> <ol><li>清华：https://pypi.tuna.tsinghua.edu.cn/simple</li> <li>阿里云：http://mirrors.aliyun.com/pypi/simple/</li> <li>中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/</li> <li>华中理工大学：http://pypi.hustunique.com/</li> <li>山东理工大学：http://pypi.sdutlinux.org/</li> <li>豆瓣：http://pypi.douban.com/simple/</li> <li>豆瓣：https://pypi.doubanio.com/simple/</li></ol> <h2 id="npm代理服务器搭建"><a href="#npm代理服务器搭建" class="header-anchor">#</a> NPM代理服务器搭建</h2> <h3 id="增加npm源"><a href="#增加npm源" class="header-anchor">#</a> 增加NPM源</h3> <p>步骤与pypi源基本相同, 创建时选择&quot;npm (proxy)&quot;方式. 源地址输入淘宝NPM源<code>http://registry.npm.taobao.org/</code>.</p> <p><img src="https://s1.ax1x.com/2020/03/28/GkmtyV.png" alt="npm源配置"></p> <h3 id="设置与使用"><a href="#设置与使用" class="header-anchor">#</a> 设置与使用</h3> <p>使用时, 可以直接设置npm源地址, 命令为<code>npm config set registry http://localhost:8081/repository/npm-proxy/</code>, 查看npm源地址命令为&quot;npm config get registry&quot;也可以在安装包时临时指定地址, 例如, 安装express包, 则使用<code>npm install express --registry=http://127.0.0.1:8081/repository/npm-proxy/</code></p> <div class="custom-block warning"><p class="custom-block-title">注意</p> <p>如果在使用配置的npm源时出现<em>401未授权</em>错误, 有可能是npm的5.0.3版本bug, 首先可以尝试升级npm, 命令为<code>npm install npm -g</code>, 然后在浏览器尝试访问对应模块地址, 如果本地url为<code>http://127.0.0.1:8081/repository/npm-proxy/</code>, 则访问<code>http://127.0.0.1:8081/repository/npm-proxy/express</code>试试, 如果弹出用户名密码输入框,则使用nexus的管理员账号密码看能不能访问, 如果可以的话, 那么在Nexus中配置匿名登录即可正常访问, 设置方式如下:<br> <img src="https://s1.ax1x.com/2020/03/28/GkuGrV.png" alt="npm设置匿名登录"><br>
设置nexus3匿名登录的好处在于, pip安装时不需要每次输入用户名密码, npm安装也不会出现401未授权错误.</p></div> <h3 id="maven代理服务器搭建"><a href="#maven代理服务器搭建" class="header-anchor">#</a> Maven代理服务器搭建</h3> <h3 id="增加maven代理"><a href="#增加maven代理" class="header-anchor">#</a> 增加Maven代理</h3> <p>创建方式跟之前的差不多, 代理地址一般用阿里巴巴的源, 地址为:<code>https://maven.aliyun.com/repository/central</code>, 阿里巴巴还有其他的maven镜像源, 可以到<a href="https://maven.aliyun.com/mvn/view" target="_blank" rel="noopener noreferrer">阿里巴巴Maven库<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>查看. 配置完毕后的页面如下:<br> <img src="https://s1.ax1x.com/2020/03/28/GknBB8.png" alt="Maven代理设置"></p> <h3 id="修改maven使用配置"><a href="#修改maven使用配置" class="header-anchor">#</a> 修改Maven使用配置</h3> <p>修改maven源地址, 打开maven的安装目录, 打开<code>conf\settings.xml</code>文件, 在<code>mirrors</code>节点下加入下面配置:</p> <div class="language-xml extra-class"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>mirror</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>id</span><span class="token punctuation">&gt;</span></span>myMaven<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>id</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>mirrorOf</span><span class="token punctuation">&gt;</span></span>*<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>mirrorOf</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>name</span><span class="token punctuation">&gt;</span></span>My Maven Repository<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>name</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>url</span><span class="token punctuation">&gt;</span></span>http://localhost:8081/repository/maven-proxy/<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>url</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>mirror</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><p>其中url标签就是Nexus提供给我们的地址.</p> <h3 id="利用命令行下载包"><a href="#利用命令行下载包" class="header-anchor">#</a> 利用命令行下载包</h3> <p>使用命令批量下载<code>pom.xml</code>中的jar包, 方法来自于<a href="https://www.cnblogs.com/luoruiyuan/p/5948181.html" target="_blank" rel="noopener noreferrer">原文<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>写一个批处理文件, 先写一个批处理文件, 内容如下所示, 然后将批处理文件和需要下载的<code>pom.xml</code>文件放在同一目录, 双击批处理文件即可.</p> <div class="language-batch extra-class"><pre class="language-batch"><code><span class="token command"><span class="token keyword">call</span> mvn <span class="token parameter attr-name">-f</span> pom.xml dependency:copy-dependencies</span>
<span class="token command"><span class="token keyword">pause</span></span>
</code></pre></div><p>一个典型的pom.xml文件如下:</p> <div class="language-xml extra-class"><pre class="language-xml"><code><span class="token prolog">&lt;?xml version=&quot;1.0&quot;?&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>project</span> <span class="token attr-name">xmlns</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>http://maven.apache.org/POM/4.0.0<span class="token punctuation">&quot;</span></span> <span class="token attr-name"><span class="token namespace">xmlns:</span>xsi</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>http://www.w3.org/2001/XMLSchema-instance<span class="token punctuation">&quot;</span></span> <span class="token attr-name"><span class="token namespace">xsi:</span>schemaLocation</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>modelVersion</span><span class="token punctuation">&gt;</span></span>4.0.0<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>modelVersion</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>temp.download<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>temp-download<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>1.0-SNAPSHOT<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencies</span><span class="token punctuation">&gt;</span></span>
    <span class="token comment">&lt;!-- 需要下载什么jar包 添加相应依赖 其余部分无需在意--&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.jasig.cas<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>cas-client-core<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>3.1.10<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
  
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencies</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>project</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><h3 id="gradle中配置使用"><a href="#gradle中配置使用" class="header-anchor">#</a> Gradle中配置使用</h3> <p>在gradle中使用自己建立的maven库</p> <div class="language-Groovy extra-class"><pre class="language-groovy"><code>repositories<span class="token punctuation">{</span>
maven<span class="token punctuation">{</span>url<span class="token string">'http://localhost:8081/repository/maven-public/'</span><span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">更新于:</span> <span class="time">8/7/2021, 12:01:15 AM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/general/markdown.html" class="prev">
        Markdown基本语法
      </a></span> <span class="next"><a href="/general/latex.html">
        Katex 公式格式速查
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.adf242e6.js" defer></script><script src="/assets/js/2.8cf67c90.js" defer></script><script src="/assets/js/30.e219df5c.js" defer></script>
  </body>
</html>
